<?php

namespace App\Http\Requests\Home;

use Illuminate\Foundation\Http\FormRequest;

class InforModifyRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'name' => 'required|max:16|alpha_dash',
            'sex' => 'required|numeric|min:1|max:3',
        ];
    }

    public function messages()
    {
        return [
           'name.required' => '昵称不能为空',
           'name.max' => '昵称过长',
           'name.alpha_dash' => '只能输入字母、数字、破折号（ - ）以及下划线（ _ ）', 
           'sex.required' => '性别不能为空',
           'sex.numeric' => '请不要搞事',
           'sex.min' => '请不要搞事',
           'sex.min' => '请不要搞事',


        ];
    }
}
